package com.zw.pdm.module.craft.service;

import com.zw.pdm.entity.craft.CraGant;
import com.zw.pdm.entity.designtask.DsnGant;
import com.zw.pdm.module.craft.mapper.ComprehensiveQueryMapper;
import com.zw.pdm.module.craft.mapper.CraftReceiveMapper;
import com.zw.pdm.module.craft.mapper.EmployeeQueryMapper;
import com.zw.pdm.module.craft.model.ComprehensiveQueryModel;
import com.zw.pdm.module.craft.repository.CraftMakeDetailRepository;
import com.zw.pdm.module.designtask.model.DsnGantWorkModel;
import com.zw.pdm.module.report.mapper.ChangeMapper;
import com.zw.pdm.module.report.mapper.PlanMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;


/**
 * @Description:
 * @Author: China.sgl
 * @Date: 2019/12/6 08:42
 */
@Service
@SuppressWarnings("all")
public class EmployeeQueryService {

    @Autowired
    private PlanMapper planMapper;
    @Autowired
    private CraftMakeDetailRepository craftMakeDetailRepository;
    @Autowired
    private CraftReceiveMapper craftReceiveMapper;
    @Autowired
    private ChangeMapper changeMapper;
    @Autowired
    private EmployeeQueryMapper employeeQueryMapper;


    public List<ComprehensiveQueryModel> selectPro(ComprehensiveQueryModel comprehensiveQueryModel) {
        return employeeQueryMapper.selectPro(comprehensiveQueryModel);
    }
    /**
     * 根据条件查询员工业绩
     *
     * @param dsnGant
     * @return
     */
    public List<DsnGantWorkModel> findTaskerWorkByQuery(CraGant craGant) {
        return employeeQueryMapper.findTaskerWorkByQuery(craGant);
    }
    /**
     * 根据条件查询分配任务
     *
     * @param dsnGant
     * @return
     */
    public List<CraGant> findDsnGantByQuery(CraGant craGant) {

        // 加载时无项目编号不显示列表数据
        if ((craGant.getProCode() == null || craGant.getProCode() == "")
                && (craGant.getProCodeQuery() == null || craGant.getProCodeQuery() == "")) {
            craGant.setProCode("无编号");
        }
        return employeeQueryMapper.findDsnGantByQuery(craGant);
    }
}
